/* @Description:midway-back/src/controllerbase.controller.ts @author:378237242@qq.com @date:2023/11/23 */
import { Inject } from "@midwayjs/core";
import { Context } from "@midwayjs/koa";

export class BaseController {
  @Inject()
  ctx: Context;

  success(data) {
    this.ctx.body = {
      code: 0,
      data: data,
    };
  }

  error(err) {
    this.ctx.body = {
      code: 1,
      data: err,
    };
  }
}
